﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<SLIC.Models.LogOnModel>" %>


<%
        /// <summary>
        /// 
        ///  <title>SLIC</title>
        ///  <description>Log on page for Log on to the User </description>
        ///  <copyRight>Copyright (c) 2011</copyRight>
        ///  <company>IronOne Technologies (Pvt)Ltd</company>
        ///  <createdOn>2011-08-05</createdOn>
        ///  <author></author>
        ///  <modification>
        ///     <modifiedBy></modifiedBy>
        ///      <modifiedDate></modifiedDate>
        ///     <description></description>
        ///  </modification>
        ///
        /// </summary>                                                                                 
    %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sri Lanka Insurance Co-operation - Motor Insurance Claim</title>
    <link href="../../../Content/css/stylesLogin.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">

        function loadPage() {
            document.getElementById('Text1').value = '...';
        }
        function UsernameClick() {
            if (document.getElementById('Text1').value != '')
                document.getElementById('Text1').value = '';
            document.getElementById('Text1').style.border = '1px Solid #E9B900';
        }
        function UsernameBlur() {
            if (document.getElementById('Text1').value == '')
                document.getElementById('Text1').value = '...';
            document.getElementById('Text1').style.border = '0';
        }
        function PasswordClick() {
            document.getElementById('Text2').style.border = '1px Solid #E9B900';
            /*  try {
            if (document.getElementById('Text2').value == 'Password') {
            if (navigator.appName == 'Microsoft Internet Explorer') {
            var newObj = document.createElement('input');
            newObj.setAttribute('type', 'password');
            newObj.setAttribute('name', document.getElementById('Text2').name);
            newObj.setAttribute('id', document.getElementById('Text2').id);
            newObj.setAttribute('class', document.getElementById('Text2').className);
            newObj.setAttribute('value', '');
            newObj.setAttribute('onblur', 'PasswordBlur()');
            newObj.setAttribute('onfocus', 'PasswordClick()');
            newObj.setAttribute('onclick', 'PasswordClick()');
            document.getElementById('Text2').parentNode.replaceChild(newObj, document.getElementById('Text2'));
            setTimeout('document.getElementById("Text2").focus();', 10);
            }
            else {
            document.getElementById('Text2').value = '';
            document.getElementById('Text2').type = 'password';
            }
            }
            } catch (err) { }*/
        }
        function PasswordBlur() {
            document.getElementById('Text2').style.border = '0';
            /*
            try {
            if (document.getElementById('Text2').value == '') {
            if (navigator.appName == 'Microsoft Internet Explorer') {
            var newObj = document.createElement('input');
            newObj.setAttribute('type', 'text');
            newObj.setAttribute('name', document.getElementById('Text2').name);
            newObj.setAttribute('id', document.getElementById('Text2').id);
            newObj.setAttribute('class', document.getElementById('Text2').className);
            newObj.setAttribute('value', 'Password');
            newObj.setAttribute('onblur', 'PasswordBlur()');
            newObj.setAttribute('onfocus', 'PasswordClick()');
            newObj.setAttribute('onclick', 'PasswordClick()');
            document.getElementById('Text2').parentNode.replaceChild(newObj, document.getElementById('Text2'));
            }
            else {
            document.getElementById('Text2').value = 'Password';
            document.getElementById('Text2').type = 'text';
            }
            }
            } catch (err) { }*/
        }

        function AlphanumericValidation(evt) {
            var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
            if (charCode == 60 || charCode == 62 || charCode == 126) {
                return false;
            }
        }
    </script>
   
</head>
<body onload="loadPage(); if(history.length>0)history.go(+1)">
    <% using (Html.BeginForm(null, null, FormMethod.Post))
       { %>
    <%  ModelState err = ViewContext.ViewData.ModelState["err"];
        SLIC.Controllers.GenException result = null;

        if (err != null)
        {
            result = (SLIC.Controllers.GenException)err.Errors.ElementAt(0).Exception;
        }%>
    <div id="LoginBoxWrapper">
        <div id="LoginBanner">
            <br />
            <img src="../../../Content/images/logo.gif" />
        </div>
        <div id="clear">
        </div>
        <div id="LoginCenterPlan">
            <div id="LoginSeparator">
            </div>
            <div id="clear">
            </div>
            <div style="text-align: center; color: #d10000; padding-bottom: 3px;" class="LoginMessage">
                <%:result.Message %></div>
            <div id="Login">
                <div id="loginBoxBody">
                    <div id="medSpacer" style="height: 30px;">
                    </div>
                    <div>
                        <table style="margin: auto;width:290px;">
                            <tr id="LoginTxtBox">
                                <td>
                                    User Name
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <%: Html.TextBoxFor(m => m.UserName, new { id = "Text1", onblur = "UsernameBlur()", @class = "TxtBox1", onclick = "UsernameClick()",type = "text",OnKeyPress="return AlphanumericValidation(event);" })%>
                                </td>
                            </tr>
                            <tr  id="medSpacer"  style="height: 5px;">
                            </tr>
                            <tr id="LoginTxtBox" >
                                  <td>
                                    Password
                                </td>
                                <td>
                                    :
                                </td>
                                <td>
                                    <%: Html.PasswordFor(m => m.Password, new { id = "Text2", onblur = "PasswordBlur()", @class = "TxtBox1", onclick = "PasswordClick()", onFocus = "PasswordClick()",type = "password",OnKeyPress="return AlphanumericValidation(event);" })%>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <%--    <div id="LoginTxtBox" style="padding-top: 0px">
                            <%: Html.TextBoxFor(m => m.UserName, new { id = "Text1", onblur = "UsernameBlur()", @class = "TxtBox1", onclick = "UsernameClick()",type = "text" })%>
                        </div>
                    Password:    <div id="LoginTxtBox" style="margin-top: 10px">
                            <%: Html.PasswordFor(m => m.Password, new { id = "Text2", onblur = "PasswordBlur()", @class = "TxtBox1", onclick = "PasswordClick()", onFocus = "PasswordClick()",type = "password" })%>
                        </div>--%>
                    <div style="margin: 5px auto 0 auto; height: auto; width: 280px; padding-top: 15px">
                        <div class="buttons">
                            <input type="submit" value="" class="LoginBtn" />
                        </div>
                    </div>
                </div>
                <div id="clear">
                </div>
            </div>
            <div id="clear">
            </div>
            <div class="footerText" style="width: 300px; margin: 10px auto; text-align: center;
                color: #FFF; overflow: hidden; display: block
                font-weight: bold;">
                &copy; Sri Lanka Insurance Co-operation LTD.
                <br />
                <font color="#464646">Powered by <b>IronOne Technologies (Pvt) Ltd.</b></font>
            </div>
        </div>
    </div>
    <% } %>
</body>
</html>
